package top.wenzz.commons.dao;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

/**
 * 不能放在Application子包下
 * Created by 钟廷员 on 2016/12/19.
 */
public interface BasicDao<E> extends CrudRepository<E, Integer>, JpaSpecificationExecutor<E> {
    // @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") })
    E findOne(Integer var1);

    // @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") })
    List<E> findAll();
    // @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") })
    Page<E> findAll(Pageable var1);
    // @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") })
    Page<E> findAll(Specification<E> var1, Pageable var2);
}
